import 'dart:io';

import 'package:dio/dio.dart';
import 'package:furaha_mkopo/net/fm_base_net_domain.dart';
import 'package:furaha_mkopo/net/fm_http_request.dart';
import 'package:furaha_mkopo/net/fm_net_param_manager.dart';

class FMAuthImageUploadApi extends FMBaseNetDomain{
  File image;
  String firm;
  String alighted;
  String card_type;
  FMAuthImageUploadApi({required this.image,required this.firm,required this.alighted,required this.card_type});

  @override
  String requestUrl() {
    return FMNetParamManager().getDefaultUrlPath("/directs/smiled");
  }

  @override
  FMHttpMethodType methodType() {
    return FMHttpMethodType.upload;
  }

  @override
  List<int>? uploadData() {
    return image.readAsBytesSync();
  }

  @override
  Map<String, dynamic> requestParams() {
    return {
      "image":MultipartFile.fromFile(
        image.path,
        filename: 'id_card.jpg', // 根据实际需要命名
      ),
      "firm": firm,"alighted":alighted,"card_type":card_type};
  }

  @override
  String requestUploadKey() {
    return "image";
  }


}